import React, { Component } from 'react';
import $ from "jquery";
import Carousel from "./home_carousel.js";
import Section1 from "./home_section1.js";
import Section2 from "./home_section2.js";

import {connect} from "react-redux";

class Homes extends Component {
  componentDidMount(){
    this.props.changeTitle("卖座电影");
  }
  render() {
    return (
      <main className="components" >
          <Carousel/>
          <Section1/>
          <Section2/>
      </main>
    );
  }
}

var Home = connect(
  function(state, ownProps) {
    return {
    }
  },
  function(dispatch, ownProps) {
   return {
      changeTitle:function(data){
          dispatch({
                type:"CHANGETITLE",
                title:data
          })
      }
   }
  }
)(Homes);

export default Home;
